#ifndef _OVERVIEWACTIONS_H_
#define _OVERVIEWACTIONS_H_

#include <buildspec.h>
#include <Geometry/ClientGeometry.h>
#include <Parsers/IParsingActions.h>

#include <boost/ptr_container/ptr_list.hpp>

namespace GST {
	namespace Geometry {
		class FileWrappingGeometry;
	}
namespace Parsers {

/**
 * This class simply reactions on fast parsing actions (Get Number of Objects from file, get there names, colors and so on ...).
 */
class GST_API_EXPORT OverviewActions
	: public IParsingActions
{
public:

	OverviewActions(std::istream & inputStream, IFileSerialisable::FileType ftype);
	virtual ~OverviewActions();

	///@name own interface
	//@{
		FileWrappingGeometry * getCurrentObject();
		Geometry::ClientGeometryListPtr getFileWrappingGeometries() const;
	//@}

	///@name IParsingActions members
	//@{
		///@name IStreamposActions
		//@{
			virtual void NewObject(const std::streampos & firstPos, const std::streampos & lastPos);
			virtual void NewObject(const std::string & content);

		//@}
		///@name IMetadataAcions
		//@{
			virtual void SetName(const std::string & name);
			virtual void SetOriginalName(const std::string & name);
			virtual void SetColor(const IGeometry::Color & color);
			virtual void SetTransparency(const IGeometry::TransparencyCode & alpha);
			virtual void SetCustomProperty(const std::string & name, const std::string & value);
			virtual void SetCRS(const std::string& crs);
		//@}
		
		///@name IGeometryAcions
		//@{
			virtual void CreateMultipoint3();
			virtual void CreateMultiline3();
			virtual void CreateMultiPolygon3();
			virtual void CreateTIN3();
			virtual void CreateTriangleNet3();
			virtual void CreateTetrahedon3();
			virtual void CreateGrid3(const GST::Parsers::GridDescription &grid_description);
			virtual void CreateSGrid3(const GST::Parsers::GridDescription &grid_description);
			virtual void CreateCollection();
			virtual void GeometryParsingFinished();
			///@name never implemented
			//@{
				virtual void addPoint(const RawPoint3& d) { }
				virtual void newSimplex() { }
				virtual void newPart(bool oldStyle=true) { }
				virtual void addTriangle(const IdxTriangle& t) { }
				virtual void addTetrahedron(const IdxTetrahedron& t) { }
				///@name IGeometryContainer
				//@{		
					virtual GeometryContainer * getGeometries() { return NULL; }
					virtual void clearGeometries() { }
				//@}
			//@}		
		//@}
		
		///@name IPropertyAcions
		//@{
			virtual int CreateVertexProperty(const std::string & name, const Geometry::SimplexProperty::PropertyType & PropertyType, const unsigned int & dims);
			virtual int CreateCellProperty(const std::string & name, const Geometry::SimplexProperty::PropertyType & PropertyType, const unsigned int & dims);
			virtual void PropertyParsingFinished();
			///@name never implemented
			//@{
				virtual void PropAddValue(const std::string & value) { }
				virtual void PropAddVector(const std::vector<std::string> & vector){ }
				virtual void PropNextObject() { }
			//@}
		//@}
	//@}

protected:
    Geometry::ClientGeometryListPtr objectContainer;

	std::istream & inputStream;
	IFileSerialisable::FileType filetype;
};

//-----------------------------------------------------------------------------------------------------------

class OverviewActionSurpac
	: public OverviewActions
{
public:	
	OverviewActionSurpac(std::istream & inputStream, IFileSerialisable::FileType ftype)
		: OverviewActions(inputStream, ftype)
	{	}

	void CreateMultipoint3(); 
	void CreateMultiline3(); 
	void CreateMultiPolygon3();	
	void CreateTIN3();	  
	void CreateTriangleNet3(); 
	void CreateTetrahedon3();
	void CreateGrid3(const GST::Parsers::GridDescription &grid_description);
	void CreateCollection();

	void packStrFile(const std::string & strfile);
};


}// namespace Parsers
}// namespace GST

#endif //_OVERVIEWACTIONS_H_
